import request from "@/utils/request";

// 查询勋章列表
export function listMedal(query) {
  return request({
    url: "/system/medal/list",
    method: "get",
    params: query,
  });
}

// 查询勋章详细
export function getMedal(id) {
  return request({
    url: "/system/medal/" + id,
    method: "get",
  });
}

// 新增勋章
export function addMedal(data) {
  return request({
    url: "/system/medal",
    method: "post",
    data: data,
  });
}

// 修改勋章
export function updateMedal(data) {
  return request({
    url: "/system/medal",
    method: "put",
    data: data,
  });
}

// 删除勋章
export function delMedal(id) {
  return request({
    url: "/system/medal/" + id,
    method: "delete",
  });
}
// 查询下一个可获得的勋章
export function getNextMedal(currentPoints) {
  return request({
    url: "/system/medal/next",
    method: "get",
    params: { currentPoints },
  });
}
